package com.wiloon.androidx;

import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.dao.RuntimeExceptionDao;
import com.wiloon.androidx.dao.DatabaseHelper;
import com.wiloon.androidx.entity.Foo;

import org.apache.log4j.Logger;

/**
 * Created by wangyue on 8/6/2014.
 */
public class FooServiceImpl extends BaseServiceImpl implements FooService {
    Logger logger = Logger.getLogger(FooServiceImpl.class);
    private RuntimeExceptionDao<Foo, Long> dao;

    public FooServiceImpl(DatabaseHelper databaseHelper) {
        super(databaseHelper);
        dao = databaseHelper.getFooDao();
    }

    @Override
    public void saveFoo(Foo foo) {
        logger.debug("save foo.");
        dao.create(foo);
    }
}
